url = '测试文件.txt'  # 文件路径
size = 1024 * 8  # 设置每次读取阈值

def FileRead(str: url, int: size):
	# 打开文件
	with open(url, 'r') as fp:
		count = 1  # 接收内容变量
		while count:
			count = fp.read(size)
			yield count


file = FileRead(url, size)

# 输出文件内容
for i in file:
	print(i)
